package com.md.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.md.model.page.PageRequest;
import com.md.util.StringUtil;
import com.md.value.enums.OperationEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 刘骄阳
 * 2022-06-12 2:12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel("分页查询日志请求实体")
public class QueryLogsRequest extends PageRequest {
  /**
   * 标题
   */
  @ApiModelProperty("标题")
  private String title;

  /**
   * 访问地址
   */
  @ApiModelProperty("访问地址")
  private String url;

  /**
   * 操作
   */
  @ApiModelProperty("操作")
  private List<OperationEnum> operation;

  /**
   * 功能模块
   */
  @ApiModelProperty("功能模块")
  private Integer module;

  @ApiModelProperty("最大时间(毫秒)")
  @JsonFormat(shape = JsonFormat.Shape.STRING)
  private Long maxTime;

  @ApiModelProperty("最小时间(毫秒)")
  @JsonFormat(shape = JsonFormat.Shape.STRING)
  private Long minTime;

  @ApiModelProperty("业务Id")
  private String dataId;

  /**
   * ip地址
   */
  @ApiModelProperty("ip地址")
  private String ipAddress;

  /**
   * 游标
   */
  @ApiModelProperty("游标")
  private LocalDateTime cursor;

  /**
   * 仅查询根
   */
  @ApiModelProperty("仅查询根")
  private Boolean onlyRoot;

  @Override
  public String toString() {
    return StringUtil.objectToJson(this);
  }
}
